package com.hs.pre.page;

public class PageImpl implements IPage {

	
	private int nextPageNumber;
	
	 /** 
     * 每一页显示的条目数 
     * 
     * @return 每一页显示的条目数 
     */ 
	private int pageSize = 10;

	
	  /** 
     * 获取上一页编码 
     * 
     * @return 上一页编码 
     */ 
	
	private int previousPageNumber;

    /** 
     * 当前页的页码 
     * 
     * @return 当前页的页码 
     */ 
	private int thisPageNumber =1;

    /**
     * 总数量
     */
	private int totalNumber;


	public int getNextPageNumber() {
		return nextPageNumber;
	}

	public void setNextPageNumber(int nextPageNumber) {
		this.nextPageNumber = nextPageNumber;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public int getPreviousPageNumber() {
		return previousPageNumber;
	}

	public void setPreviousPageNumber(int previousPageNumber) {
		this.previousPageNumber = previousPageNumber;
	}



	public int getThisPageNumber() {
		return thisPageNumber;
	}

	public void setThisPageNumber(int thisPageNumber) {
		this.thisPageNumber = thisPageNumber;
	}

	public int getTotalNumber() {
		return totalNumber;
	}

	public void setTotalNumber(int totalNumber) {
		this.totalNumber = totalNumber;
	}


	public boolean isFirstPage() {
		// TODO Auto-generated method stub
		return this.thisPageNumber==1;
	}

	public boolean isLastPage() {
		// TODO Auto-generated method stub
		return this.thisPageNumber == this.getTotalPage();
	}

	public int getTotalPage() {
		// TODO Auto-generated method stub
		return (this.totalNumber+(this.pageSize-1))/this.pageSize;
	}

	public int getThisNum() {
		// TODO Auto-generated method stub
		return (getPageSize()*getThisPageNumber())-getPageSize()+1;
	}



}
